package com.db.williamchart.data;

public class Paddings {
    private Float left;
    private Float top;
    private Float right;
    private Float bottom;

    public Paddings(Float left, Float top, Float right, Float bottom) {
        this.left = left;
        this.top = top;
        this.right = right;
        this.bottom = bottom;
    }

    public Paddings(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) {
        this.left = (float) paddingLeft;
        this.top = (float) paddingTop;
        this.right = (float) paddingRight;
        this.bottom = (float) paddingBottom;
    }

    public Paddings mergeWith(Paddings s){
        return new Paddings(
                Math.max(this.left,s.left),
                Math.max(this.top,s.top),
                Math.max(this.right,s.right),
                Math.max(this.bottom,s.bottom)
        );
    }
    public static Paddings mergeWith(Paddings f,Paddings s){
        return new Paddings(
                Math.max(f.left,s.left),
                Math.max(f.top,s.top),
                Math.max(f.right,s.right),
                Math.max(f.bottom,s.bottom)
        );
    }

    public Float getLeft() {
        return left;
    }

    public void setLeft(Float left) {
        this.left = left;
    }

    public Float getTop() {
        return top;
    }

    public void setTop(Float top) {
        this.top = top;
    }

    public Float getRight() {
        return right;
    }

    public void setRight(Float right) {
        this.right = right;
    }

    public Float getBottom() {
        return bottom;
    }

    public void setBottom(Float bottom) {
        this.bottom = bottom;
    }
}
